<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: BaseConnectionManager::CoordSet Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00066.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a>  </div>
  <div class="headertitle">
<div class="title">BaseConnectionManager::CoordSet Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="BaseConnectionManager::CoordSet" -->
<p>Represents an minimalistic (hash)set of GridCoords.  
 <a href="a00066.html#details">More...</a></p>

<p><a href="a00572.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5c4c714b303d8a6ccae2628c22357556"></a><!-- doxytag: member="BaseConnectionManager::CoordSet::CoordSet" ref="a5c4c714b303d8a6ccae2628c22357556" args="(unsigned sz)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00066.html#a5c4c714b303d8a6ccae2628c22357556">CoordSet</a> (unsigned sz)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the set (hashtable) with the a specified size. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3f1d637881b9e4ca2a306295eacdc634"></a><!-- doxytag: member="BaseConnectionManager::CoordSet::~CoordSet" ref="a3f1d637881b9e4ca2a306295eacdc634" args="()" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00066.html#a3f1d637881b9e4ca2a306295eacdc634">~CoordSet</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Delete every created <a class="el" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a>. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaa3c6a4f31789b4644a5bb7aaf414206"></a><!-- doxytag: member="BaseConnectionManager::CoordSet::add" ref="aaa3c6a4f31789b4644a5bb7aaf414206" args="(const GridCoord &amp;c)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00066.html#aaa3c6a4f31789b4644a5bb7aaf414206">add</a> (const <a class="el" href="a00097.html">GridCoord</a> &amp;c)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a <a class="el" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a> to the set. If a <a class="el" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a> with the same value already exists in the set nothing happens. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a02d6a8788ed22b635e7d8edbcb576d9d"></a><!-- doxytag: member="BaseConnectionManager::CoordSet::next" ref="a02d6a8788ed22b635e7d8edbcb576d9d" args="()" -->
<a class="el" href="a00097.html">GridCoord</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00066.html#a02d6a8788ed22b635e7d8edbcb576d9d">next</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the next <a class="el" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a> in the set. You can iterate through the set only one time with this function! <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adc447bc3bef91b0edd4349b803a48da1"></a><!-- doxytag: member="BaseConnectionManager::CoordSet::getSize" ref="adc447bc3bef91b0edd4349b803a48da1" args="() const " -->
unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00066.html#adc447bc3bef91b0edd4349b803a48da1">getSize</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of GridCoords currently saved in this set. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad4c6538276bc45a1efdeb8ebbfaf3d9f"></a><!-- doxytag: member="BaseConnectionManager::CoordSet::getmaxSize" ref="ad4c6538276bc45a1efdeb8ebbfaf3d9f" args="() const " -->
unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00066.html#ad4c6538276bc45a1efdeb8ebbfaf3d9f">getmaxSize</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the maximum number of elements which can be stored inside this set. To prevent collisions the set should never be more than 75% filled. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00066.html#a6f6a48e14b2c80e70d66f8fd3310df65">insert</a> (const <a class="el" href="a00097.html">GridCoord</a> &amp;c, unsigned pos)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Tries to insert a <a class="el" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a> at the specified position.  <a href="#a6f6a48e14b2c80e70d66f8fd3310df65"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6bf527335c1f943a562a948d63e1c435"></a><!-- doxytag: member="BaseConnectionManager::CoordSet::data" ref="a6bf527335c1f943a562a948d63e1c435" args="" -->
std::vector&lt; <a class="el" href="a00097.html">GridCoord</a> * &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00066.html#a6bf527335c1f943a562a948d63e1c435">data</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Holds the hash table. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab92f6508285f667d0e7f811c74c048cc"></a><!-- doxytag: member="BaseConnectionManager::CoordSet::maxSize" ref="ab92f6508285f667d0e7f811c74c048cc" args="" -->
unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00066.html#ab92f6508285f667d0e7f811c74c048cc">maxSize</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">maximum size of the hash table. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a81adb787e364efa97276766eb19fe644"></a><!-- doxytag: member="BaseConnectionManager::CoordSet::size" ref="a81adb787e364efa97276766eb19fe644" args="" -->
unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00066.html#a81adb787e364efa97276766eb19fe644">size</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Current number of entries in the hash table. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0bdf347931c8b2c7ae970769291a804e"></a><!-- doxytag: member="BaseConnectionManager::CoordSet::current" ref="a0bdf347931c8b2c7ae970769291a804e" args="" -->
unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00066.html#a0bdf347931c8b2c7ae970769291a804e">current</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Holds the current element when iterating over this table. <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Represents an minimalistic (hash)set of GridCoords. </p>
<p>It is a workaround because c++ doesn't come with an hash set. </p>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a6f6a48e14b2c80e70d66f8fd3310df65"></a><!-- doxytag: member="BaseConnectionManager::CoordSet::insert" ref="a6f6a48e14b2c80e70d66f8fd3310df65" args="(const GridCoord &amp;c, unsigned pos)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void BaseConnectionManager::CoordSet::insert </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="a00097.html">GridCoord</a> &amp;&#160;</td>
          <td class="paramname"><em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>pos</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Tries to insert a <a class="el" href="a00097.html" title="Represents a position inside a grid.">GridCoord</a> at the specified position. </p>
<p>If the same <a class="el" href="a00065.html" title="Class for storing 3D coordinates.">Coord</a> already exists there nothing happens. If an other <a class="el" href="a00065.html" title="Class for storing 3D coordinates.">Coord</a> already exists there calculate a new Position to insert end recursively call this Method again. If the spot is empty the <a class="el" href="a00065.html" title="Class for storing 3D coordinates.">Coord</a> is inserted. </p>
<div class="fragment"><pre class="fragment">                                                  {
      <span class="keywordflow">if</span>(<a class="code" href="a00066.html#a6bf527335c1f943a562a948d63e1c435" title="Holds the hash table.">data</a>[pos] == 0) {
        <a class="code" href="a00066.html#a6bf527335c1f943a562a948d63e1c435" title="Holds the hash table.">data</a>[pos] = <span class="keyword">new</span> GridCoord(c);
        <a class="code" href="a00066.html#a81adb787e364efa97276766eb19fe644" title="Current number of entries in the hash table.">size</a>++;
      } <span class="keywordflow">else</span> {
        <span class="keywordflow">if</span>(*<a class="code" href="a00066.html#a6bf527335c1f943a562a948d63e1c435" title="Holds the hash table.">data</a>[pos] != c) {
          <a class="code" href="a00066.html#a6f6a48e14b2c80e70d66f8fd3310df65" title="Tries to insert a GridCoord at the specified position.">insert</a>(c, (pos + 2) % <a class="code" href="a00066.html#ab92f6508285f667d0e7f811c74c048cc" title="maximum size of the hash table.">maxSize</a>);
        }
      }
    }
</pre></div>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>D:/Projects/MiXiM/extsrc/mixim/src/base/connectionManager/<a class="el" href="a00245_source.html">BaseConnectionManager.h</a></li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00019.html">BaseConnectionManager</a>      </li>
      <li class="navelem"><a class="el" href="a00066.html">CoordSet</a>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:31 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
